<template>
	<div style="height: 400px;border: 1px solid blue;">
	<h2>修改密码-</h2>
		<hr >
		<table border="1">
			<tr>
				<td>旧密码</td>
				<td><input type="text" name="" v-model="data.users.oldpwd" /></td>
			</tr>
			<tr>
				<td>新密码第一次</td>
				<td><input type="password" name="" v-model="data.users.newpwd" /></td>
			</tr>
			<tr>
				<td>新密码第二次</td>
				<td><input type="password" name="" v-model="data.users.newpwd1" /></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" @click="update()" /></td>
			</tr>
		</table>
		
	</div>
</template>

<script setup>
	import {ref,reactive,onMounted} from 'vue';
		import {$get,$postx,$postj,$postf} from "../../ajax/index.js";
		import myalert from "../../utils/myalert.js";
		const data = reactive({
			users:[]
		})
		
		function update(){
			console.log(data.users);
			if(data.users.newpwd != data.users.newpwd1){
				console.log("两次新密码不一致");
				return;
			}
			if(data.users.newpwd == data.users.newpwd1){
					$postx("/api/user/updatePwd?oldPwd="+data.users.oldpwd+"&newPwd="+data.users.newpwd1)
					.then((resp)=>{
						
					})
				}		
		}
		
</script>

<style>
</style>
